#!/usr/bin/env python
#--*-- coding: utf-8 --*--

import Tkinter as tk;

class Application(tk.Frame):
    def __init__(self, master=None):
        tk.Frame.__init__(self, master);
        # 这行代码是做什么的？
        self.grid();
        self.createWidgets();

    def createWidgets(self):
        self.quitButton = tk.Button(self, text="Quit", command=self.quit);
        self.quitButton.grid();

app = Application();
app.master.title("Sample application");
app.mainloop();
